<?php



/**
 * This class defines the structure of the 'category' table.
 *
 *
 *
 * This map class is used by Propel to do runtime db structure discovery.
 * For example, the createSelectSql() method checks the type of a given column used in an
 * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
 * (i.e. if it's a text column type).
 *
 * @package    propel.generator.ise-php.map
 */
class CategoryTableMap extends TableMap
{

	/**
	 * The (dot-path) name of this class
	 */
	const CLASS_NAME = 'ise-php.map.CategoryTableMap';

	/**
	 * Initialize the table attributes, columns and validators
	 * Relations are not initialized by this method since they are lazy loaded
	 *
	 * @return     void
	 * @throws     PropelException
	 */
	public function initialize()
	{
		// attributes
		$this->setName('category');
		$this->setPhpName('Category');
		$this->setClassname('Category');
		$this->setPackage('ise-php');
		$this->setUseIdGenerator(false);
		// columns
		$this->addPrimaryKey('CATNAME', 'Catname', 'VARCHAR', true, 50, null);
		$this->addForeignKey('UPGRADE', 'Upgrade', 'VARCHAR', 'category', 'CATNAME', false, 50, null);
		$this->addColumn('DESCRIPTION', 'Description', 'VARCHAR', false, 255, null);
		$this->addColumn('PRICE', 'Price', 'INTEGER', true, 10, null);
		$this->addColumn('MINAGE', 'Minage', 'INTEGER', false, 10, 18);
		// validators
	} // initialize()

	/**
	 * Build the RelationMap objects for this table relationships
	 */
	public function buildRelations()
	{
		$this->addRelation('CategoryRelatedByUpgrade', 'Category', RelationMap::MANY_TO_ONE, array('upgrade' => 'catname', ), 'SET NULL', null);
		$this->addRelation('CategoryRelatedByCatname', 'Category', RelationMap::ONE_TO_MANY, array('catname' => 'upgrade', ), 'SET NULL', null, 'CategorysRelatedByCatname');
		$this->addRelation('Model', 'Model', RelationMap::ONE_TO_MANY, array('catname' => 'catname', ), null, null, 'Models');
		$this->addRelation('Offers', 'Offers', RelationMap::ONE_TO_MANY, array('catname' => 'catname', ), 'CASCADE', null, 'Offerss');
		$this->addRelation('Reservation', 'Reservation', RelationMap::ONE_TO_MANY, array('catname' => 'catname', ), null, null, 'Reservations');
	} // buildRelations()

} // CategoryTableMap
